New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update doc to use fs.ErrNotExist #115
Conversation
@@ -15,7 +15,7 @@ import ( | |||
// | |||
// If a non-existent path is specified, an appropriate error is returned. | |||
// In case the caller is not interested in this particular error, it should | |||
// be handled separately using e.g. errors.Is(err, os.ErrNotExist). | |||
// be handled separately using e.g. errors.Is(err, fs.ErrNotExist). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is os.ErrNotExist
deprecated yet? If not, it does not make sense to change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not deprecated; but its recommended for new code to use errors.Is(err, fs.ErrNotExist).
Ref: https://pkg.go.dev/os#ErrNotExist
If it does not make sense, I can close this PR. Thank you for taking the time to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks!
Signed-off-by: Manu Gupta <manugupt1@gmail.com>
@thaJeztah PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
in practice I often use the "os" variant (its just an alias of "fs" now, but saves adding another import
There are two nits: